package com.allqj;

/**
 * @author sjw
 * @className BenchMark
 * @date 2021/9/1 10:35
 * @description: TODO
 */
public class BenchMark {
    public static void main(String[] args) {
        System.out.println(str2int("123"));

        System.out.println(Integer.valueOf("123"));
    }

    public static int str2int(String s){
        int  result=0;
        int length=s.length();
        for(int i=0;i<length;i++){
            result=result*10+s.charAt(i)-48;
        }


        return result;

    }
}
